
if [ ! -e usr/lib/libreadline.so.6 -a ! -e lib/libreadline.so.6 ];then
  [ -e usr/lib/libreadline.so.7 ] && ln -s libreadline.so.7 usr/lib/libreadline.so.6
  [ -e lib/libreadline.so.7 ] && ln -s libreadline.so.7 lib/libreadline.so.6
fi

if [ ! -e usr/lib/libreadline.so.6 -a ! -e lib/libreadline.so.6 ];then
  [ -e usr/lib/libreadline.so.5 ] && ln -s libreadline.so.5 usr/lib/libreadline.so.6
  [ -e lib/libreadline.so.5 ] && ln -s libreadline.so.5 lib/libreadline.so.6
fi

if [ ! -e usr/lib/libhistory.so.6 -a ! -e lib/libhistory.so.6 ];then
  [ -e usr/lib/libhistory.so.7 ] && ln -s libhistory.so.7 usr/lib/libhistory.so.6
  [ -e lib/libhistory.so.7 ] && ln -s libhistory.so.7 lib/libhistory.so.6
fi

if [ ! -e usr/lib/libhistory.so.6 -a ! -e lib/libhistory.so.6 ];then
  [ -e usr/lib/libhistory.so.5 ] && ln -s libhistory.so.5 usr/lib/libhistory.so.6
  [ -e lib/libhistory.so.5 ] && ln -s libhistory.so.5 lib/libhistory.so.6
fi

if [ ! -e usr/lib/libreadline.so.5 -a ! -e lib/libreadline.so.5 ];then
  [ -e usr/lib/libreadline.so.6 ] && ln -s libreadline.so.6 usr/lib/libreadline.so.5
  [ -e lib/libreadline.so.6 ] && ln -s libreadline.so.6 lib/libreadline.so.5
fi

if [ ! -e usr/lib/libhistory.so.5 -a ! -e lib/libhistory.so.5 ];then
  [ -e usr/lib/libhistory.so.6 ] && ln -s libhistory.so.6 usr/lib/libhistory.so.5
  [ -e lib/libhistory.so.6 ] && ln -s libhistory.so.6 lib/libhistory.so.5
fi
